package com.ruoyi.project.modules.virtualUsageGroup.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.modules.virtualUsageGroup.mapper.VirtualUsageGroupMapper;
import com.ruoyi.project.modules.virtualUsageGroup.domain.VirtualUsageGroup;
import com.ruoyi.project.modules.virtualUsageGroup.service.IVirtualUsageGroupService;
import com.ruoyi.common.core.text.Convert;

/**
 * 虚拟用况组Service业务层处理
 * 
 * @author smallrain
 * @date 2022-04-19
 */
@Service
public class VirtualUsageGroupServiceImpl implements IVirtualUsageGroupService
{
    @Autowired
    private VirtualUsageGroupMapper virtualUsageGroupMapper;

    /**
     * 查询虚拟用况组
     * 
     * @param id 虚拟用况组主键
     * @return 虚拟用况组
     */
    @Override
    public VirtualUsageGroup selectVirtualUsageGroupById(Long id)
    {
        return virtualUsageGroupMapper.selectVirtualUsageGroupById(id);
    }

    /**
     * 查询虚拟用况组列表
     * 
     * @param virtualUsageGroup 虚拟用况组
     * @return 虚拟用况组
     */
    @Override
    public List<VirtualUsageGroup> selectVirtualUsageGroupList(VirtualUsageGroup virtualUsageGroup)
    {
        return virtualUsageGroupMapper.selectVirtualUsageGroupList(virtualUsageGroup);
    }

    /**
     * 新增虚拟用况组
     * 
     * @param virtualUsageGroup 虚拟用况组
     * @return 结果
     */
    @Override
    public int insertVirtualUsageGroup(VirtualUsageGroup virtualUsageGroup)
    {
        virtualUsageGroup.setCreateTime(DateUtils.getNowDate());
        return virtualUsageGroupMapper.insertVirtualUsageGroup(virtualUsageGroup);
    }

    /**
     * 修改虚拟用况组
     * 
     * @param virtualUsageGroup 虚拟用况组
     * @return 结果
     */
    @Override
    public int updateVirtualUsageGroup(VirtualUsageGroup virtualUsageGroup)
    {
        virtualUsageGroup.setUpdateTime(DateUtils.getNowDate());
        return virtualUsageGroupMapper.updateVirtualUsageGroup(virtualUsageGroup);
    }

    /**
     * 批量删除虚拟用况组
     * 
     * @param ids 需要删除的虚拟用况组主键
     * @return 结果
     */
    @Override
    public int deleteVirtualUsageGroupByIds(String ids)
    {
        return virtualUsageGroupMapper.deleteVirtualUsageGroupByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除虚拟用况组信息
     * 
     * @param id 虚拟用况组主键
     * @return 结果
     */
    @Override
    public int deleteVirtualUsageGroupById(Long id)
    {
        return virtualUsageGroupMapper.deleteVirtualUsageGroupById(id);
    }

    @Override
    public void editModel(VirtualUsageGroup virtualUsageGroup) {
        this.virtualUsageGroupMapper.editModel(virtualUsageGroup);
    }
}
